import unittest
import sys
import re
sys.path.append("..")
import idiolectalyzer
import idiolectalyzer_feeder
import collections

def readTestText(testTextFile):
    with open(testTextFile,'r') as testFile:
        testText=testFile.read()
    testFile.close()
    return testText

class testTextFeed(unittest.TestCase):
    def testCountWords(self):
        testTextFile="mockdata/251words.txt"
        expectedCount = 251
        testText = readTestText(testTextFile)
        countedCount=idiolectalyzer_feeder.countWordsIn(testText)
        self.assertEqual(countedCount,expectedCount)
        
        testTextFile="mockdata/26213words.txt"
        expectedCount = 26213
        testText = readTestText(testTextFile)
        countedCount=idiolectalyzer_feeder.countWordsIn(testText)
        self.assertEqual(countedCount,expectedCount)
    
    def testCheckWordCount(self):
        #this is a simple arithmatic operation.
        pass
    